/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.chalmers.AV_2DPlatformerMyGame.Model;

import edu.chalmers.AV_2DPlatformerFramework.Model.GameObject;
import edu.chalmers.AV_2DPlatformerFramework.Model.Hitbox;
import edu.chalmers.AV_2DPlatformerFramework.Model.Texture;
import edu.chalmers.AV_2DPlatformerFramework.Utility.Vector2D;

/**
 * @version 0.1
 * @author Andrea Buchholz
 */
public class Object_Box extends GameObject {
    
    public Object_Box() throws Hitbox.HitboxMalformedException {
        super(null);
        Vector2D[] vertices = {new Vector2D(0, 0), new Vector2D(45, 0),
                new Vector2D(45, 34), new Vector2D(0, 34)};
        setHitbox(new Hitbox(vertices));
        String s = System.getProperty("file.separator");
        addTexture(new Texture("."+s+"src"+s+"main"+s+"java"+s+"Textures"
                            +s+"box.png", this.getHitbox().getBounds2D()));
        setVelocity(new Vector2D(0,0));
    }

    @Override
    public void onCollision(GameObject otherObject) {
    }

    @Override
    public GameObject copy() {
        try {
           Object_Box copy = new Object_Box();
           this.copyVariablesTo(copy);
           return copy;
        } catch (Hitbox.HitboxMalformedException ex) {
            return null;
        }
    }
}